//
// Created by lenovo on 2024/1/17.
//
#include<bits/stdc++.h>
using namespace std;
string s1,s2;
int main()
{
    cin >> s1 >> s2;
    int len1 = s1.length();
    int len2 = s2.length();
    s1 = s1 + s1;
    int ans = 0;
    for(int i = 0;i < len1;i++)
    {
        int cnt = 0;
        for(int j = 0;j < len2;j++)
        {
            if(s1[i + j] == s2[j])//重点！！
              cnt++;
        }
        if(cnt == len2)
            ans++;
    }
    cout << ans <<endl;
    return 0;
}
